Skip to content

sync: mirror from thyn-ai/codna@7b4a09e0be48b2a45f41c973fe499b9c4faf4a60 - #73

Closed
0xamlab wants to merge 1 commit into
mainfrom
sync/7b4a09e0be48b2a45f41c973fe499b9c4faf4a60
Closed

0xamlab wants to merge 1 commit into
mainfrom
sync/7b4a09e0be48b2a45f41c973fe499b9c4faf4a60

Conversation

@0xamlab

@0xamlab 0xamlab commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Automated mirror of cli/ (flattened), the root allowlist (server.json, glama.json, LICENSE, .gitleaks.toml) and the public-root/ community tree from thyn-ai/codna at 7b4a09e0be48b2a45f41c973fe499b9c4faf4a60. Merges itself via auto-merge once the mirror's required checks (codna review, Analyze (python)) pass and the codna-ai review approves; if a later sync lands first, this PR is closed as superseded -- every sync PR is a full snapshot of the exported surface.

@0xamlab
0xamlab enabled auto-merge (squash) November 6, 2026 20:56
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Thanks for opening your first pull request in the Codna CLI! Please make sure the checks are green and that the change follows CONTRIBUTING.md. A maintainer will review it shortly.

@0xamlab

0xamlab commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #74 (a later thyn-ai/codna commit). Every sync PR is a full snapshot of the exported surface, so this one carries nothing #74 does not. Closing.

@0xamlab 0xamlab closed this Nov 6, 2026
auto-merge was automatically disabled November 6, 2026 20:57

Pull request was closed

@0xamlab
0xamlab deleted the sync/7b4a09e0be48b2a45f41c973fe499b9c4faf4a60 branch November 6, 2026 20:57

@codna-ai codna-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codna review — 2 finding(s): 2 inline, 0 in summary.

Reply @codna fix on a finding to have Codna open a verified, test-green, risk-gated fix PR.

⏸ Not approved: 2 medium/high finding(s) in this review.

Comment thread tests/test_packaging.py
assert "write_sidecar_stamp(" in compile_section, "the compile must emit the stamp"
assert "cli_version(cli_source)" in compile_section, "the stamp version must come from cli/pyproject.toml"
assert "sidecar_build_id()" in compile_section
assert compile_section.index("_assert_sidecar_binary_clean(binary)") < compile_section.index("write_sidecar_stamp(")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM · correctness — str.index() inside assert raises ValueError instead of AssertionError on mismatc

Line 815 calls compile_section.index("_assert_sidecar_binary_clean(binary)") and compile_section.index("write_sidecar_stamp(") directly inside an assert statement. If either substring is absent from compile_section, Python raises ValueError (from str.index) rather than AssertionError. pytest reports the failure as an unexpected exception with no descriptive message, making CI failures hard to diagnose. The same problem applies to builder.index(...) on line 811: if either function-definition marker is absent from the script, ValueError is raised before any assertion fires. The fix is to use in checks with explicit assert ... , message statements or str.find() comparisons.

Reply @codna fix and Codna opens a verified, test-green, risk-gated fix PR.

Comment thread tests/test_packaging.py
whatever stamp was on disk, and no unit test of the writer alone would notice the wiring being absent.
"""
builder = RELEASE_BUILDER.read_text(encoding="utf-8")
compile_section = builder[builder.index("def prepare_agent_core_bundle(") : builder.index("def verify_staged_runtime(")]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM · correctness — Silent empty slice when verify_staged_runtime precedes prepare_agent_core_bundle

The slice builder[builder.index("def prepare_agent_core_bundle(") : builder.index("def verify_staged_runtime(")] relies on the two function definitions appearing in a specific order in the source file. If "def verify_staged_runtime(" appears before "def prepare_agent_core_bundle(" (or if the file is reorganized), str.index returns a smaller offset for the end than the start, and Python's string slicing silently produces an empty string. Lines 812–814 then fail with uninformative messages (string not found in ""), and line 815 raises ValueError. There is no guard against this ordering inversion.

Reply @codna fix and Codna opens a verified, test-green, risk-gated fix PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant